﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Fiche_Personnes
{
    class Note
    {
        public Note(string note, params string[] tags)
        {
            this.m_Note = note;
            this.m_Tags = new SortedSet<string>();
            foreach(string tag in tags) 
                if(!this.m_Tags.Add(tag)) 
                    throw new Exception("Impossible d'ajouter le tag " + tag + " à la note " + note);
        }

        private string m_Note;
        public string Annotation { get { return this.m_Note; } }
        public bool Correspond(string tagCherche)
        {
            foreach(string tag in this.m_Tags)
                if(tag.ToLower().Contains(tagCherche.ToLower()))
                    return true;
            return false;
        }
        private SortedSet<string> m_Tags;
    }
}
